"use strict";
var ki = {
    statusCode: {ok: 200, error: 300, timeout: 301},
    init: function(opts) {
        var _opts = {
            selector: "[target='pjax']", container: ".content", show: "fade", prefix: "用", suffix: "户",
            initUI: function(dom) {
                var $p = $(dom || document);
                $("[data-toggle='tooltip']", $p).tooltip();
            }, callback: function(status) {
                //alert(ki.statusCode.ok);
            }
        };
        $.pjax($.extend(_opts, opts));//初始化
    }
};

(function($) {
    $.extend(String.prototype, {
        startsWith: function(pattern) {
            return this.indexOf(pattern) === 0;
        },
        endsWith: function(pattern) {
            var d = this.length - pattern.length;
            return d >= 0 && this.lastIndexOf(pattern) === d;
        },
        isUrl: function() {
            return (new RegExp(/^[a-zA-z]+:\/\/([a-zA-Z0-9\-\.]+)([-\w .\/?%&=:]*)$/).test(this));
        }
    });
})(jQuery);
